package com.baichang.taoshunda.service.impl;

import com.baichang.taoshunda.dao.GoodsSpecValueDao;
import com.baichang.taoshunda.service.GoodsSpecValueService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created by ${wushenglu} on 17/11/16.
 */
@Service
public class GoodsSpecValueServiceImpl implements GoodsSpecValueService {
    @Autowired
    private GoodsSpecValueDao goodsSpecValueDao;

    @Override
    public boolean updateSpecValue(Integer specValueId, String valueName, Double price) {
        return goodsSpecValueDao.updateSpec(specValueId,valueName,price);
    }
    /**
     * 查询对应商品的规格的价格
     *
     * @param goodsId    商品编号
     * @param specValues 商品规格
     * @return
     */
    @Override
    public double getPriceBySpecAndGoodsId(int goodsId, String specValues) {

        return goodsSpecValueDao.getPriceBySpecAndGoodsId(goodsId,specValues);
    }
}
